<template>
    <div>
        <el-dialog v-model="dialogVisible" :title="flag ? '新增' : '编辑'" width="500">
            <el-form :model="forms" style="max-width: 600px">
                <el-form-item label="学生ID" v-if="!flag">
                    <el-input v-model="forms.id" type="text" autocomplete="off" :disabled="!flag" />
                </el-form-item>
                <el-form-item label="学生学号">
                    <el-input v-model="forms.stuNo" type="text" autocomplete="off" />
                </el-form-item>
                <el-form-item label="学生姓名">
                    <el-input v-model="forms.stuName" />
                </el-form-item>
                <el-form-item label="学生班级">
                    <el-input v-model="forms.className" />
                </el-form-item>
                <el-form-item label="学院名称">
                    <el-input v-model="forms.collegeid" />
                </el-form-item>
                <el-form-item label="市场部">
                    <el-input v-model="forms.origin" />
                </el-form-item>
                <el-form-item label="学生专业">
                    <el-input v-model="forms.expertiseid" />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm">
                        确定
                    </el-button>
                    <el-button @click="cancel">取消</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>

        <el-dialog v-model="dialogVisible1" title="查看学生信息" width="500">
            <el-form :model="forms" style="max-width: 700px">
                <el-form-item label="学生ID" v-if="!flag">
                    <el-input v-model="forms.id" type="text" autocomplete="off" :disabled="!flag" />
                </el-form-item>
                <el-form-item label="编号">
                    <el-text class="mx-1">{{ watchData.id }}</el-text>
                </el-form-item>
                <el-form-item label="姓名">
                    <el-text class="mx-1">{{ watchData.stuName }}</el-text>
                </el-form-item>
                <el-form-item label="学号">
                    <el-text class="mx-1">{{ watchData.stuNo }}</el-text>
                </el-form-item>
                <el-form-item label="班级">
                    <el-text class="mx-1">{{ watchData.className }}</el-text>
                </el-form-item>
                <el-form-item label="出处">
                    <el-text class="mx-1">{{ watchData.origin }}</el-text>
                </el-form-item>
                <el-form-item label="专业">
                    <el-text class="mx-1">{{ watchData.createdTime }}</el-text>
                </el-form-item>
                <el-form-item>
                    <el-button @click="closeDialog">关闭</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>

        <el-dialog v-model="dialogVisible2" title="用户导入" width="800">
            <el-upload class="upload-demo" drag action="#" :http-request="handleStudentEnter" multiple>
                <el-icon class="el-icon--upload"><upload-filled /></el-icon>
                <div class="el-upload__text">
                    将文件拖到此处，或 <em>点击上传</em>
                </div>
                <template #tip>
                    111
                </template>
            </el-upload>
            <template #footer>
                <el-button type="primary" @click="butQueding">提交</el-button>
                <el-button @click="closeDialog2">关闭</el-button>
            </template>
        </el-dialog>
    </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'
const props = defineProps({
    visible: Boolean,
    flag: Boolean,
    forms: Object,
})
const emit = defineEmits(['submitForm', 'cancel', 'closeDialog', 'handleStudentEnter', 'butQueding', 'closeDialog2'])
const submitForm = () => {
    emit('submitForm')
}
const cancel = () => {
    emit('cancel')
}
const closeDialog = () => {
    emit('closeDialog')
}
const handleStudentEnter = () => {
    emit('handleStudentEnter')
}
const butQueding = () => {
    emit('butQueding')
}
const closeDialog2 = () => {
    emit('closeDialog2')
}
</script>

<style scoped></style>
